import {
  FormItemType,
  DictionaryType,
  ParamsType,
  TableKeyListItemType,
} from "@/common/types/conf";

// 筛选字段
export const form: Array<FormItemType> = [
  {
    type: "input",
    tip: "考试ID",
    searchKey: "planCode",
  },
  {
    type: "input",
    tip: "考试关键字",
    searchKey: "titleFuzzy",
  },
  {
    type: "select",
    tip: "考试状态",
    searchKey: "status",
  },
];

// 筛选条件
export const params: ParamsType = {
  planCode: "",
  titleFuzzy: "",
  status: "",
};

// 筛选下拉表单 value value
export const dictionary: DictionaryType = {
  status: [
    { value: 0, label: "禁用" },
    { value: 1, label: "未开考" },
    { value: 2, label: "考试中" },
    { value: 3, label: "已结束" },
  ],
  isEnabled: [
    { value: 0, label: "禁用" },
    { value: 1, label: "启用" },
  ],
  cycleType: [
    { value: 1, label: "仅一次" },
    { value: 2, label: "每日一次" },
    { value: 3, label: "每周一次" },
    { value: 4, label: "每月一次" },
  ],
};

// 列表 value name
export const tableKeyList: Array<TableKeyListItemType> = [
  {
    key: "planCode",
    label: "ID",
  },
  {
    key: "title",
    label: "考试",
  },
  {
    key: "status",
    label: "状态",
  },
  {
    key: "cycleType",
    label: "循环方式",
  },
  {
    key: "tmRand",
    label: "考试时间",
    width: 240,
  },
  {
    key: "brief",
    label: "备注",
    width: 250,
    type: "ellipsis",
  },
];
